subroutine wmbej_iefmn_t1fj_t1bn(wmbej, iabij,& 
              t1, icore, fact)
!
use mod_size
use mod_ioff
use mod_iop
use mod_orbit 
implicit none
!
real*8, intent(in) :: fact
real*4, intent(in) :: wmbej(*)
real*4, intent(in) :: iabij(*)
!
real*4, intent(inout) :: t1(*)
real*4, intent(inout) :: icore(*)
!
integer :: i, j, a, b, nsize
integer :: i0, i1, i2, i3, i4, i5
integer, external :: idsymsoc
real*8, external :: dnrm2 
!one should note that wmbej was sort as <em, bj>
!this is to do wmbej = wmbej - t1(fj)*t1(bn)*<ef||mn>
i0 = 1          
i1 = i0 + nvvoo*isd 
i2 = i1 + nvvoo*isd
i3 = i2 + nvvoo*isd 
i4 = i3 + nvvoo*isd
!==EMBJ AAAA
!--<EF||MN>*t1(FJ)*t1(BN)

call myicopyso(iabij(ioi3(2)), icore(i1), nioi32)
call isymtrso(iabij(ioi3(2)), icore(i0), vrta, vrta, 1, 1, popa, popa, 1, 0, 1)
call axpyso(nioi32, -1.d0, icore(i0), 1, icore(i1), 1)
call itranspso(icore(i1), icore(i0), vrta, vrta, 1, popa, popa, 1, 1)
call VpqrmVms_to_Vpqrs(icore(i0), t1(ifvo(1)), 1, 1, vrta, &
                 popa, popa, 1, vrta, popa, icore(i1), 1, 1.d0, 0.d0) 
!--<MN||EJ> to tmp(EJ,MN) 
call itranspso(icore(i1), icore(i0), popa, popa, 1, vrta, popa, 1, 1) 
call VpqrmVsm_to_Vpqrs(icore(i0), t1(ifvo(1)), 1, 1, popa, &
                 vrta, popa, 1, popa, vrta, icore(i1), 1, 1.d0, 0.d0)
!--tmp(EJ,MB) to EMBJ
call sstgenso(icore(i1), icore(i0), nsize, vrta, popa, popa, vrta, & 
              icore, 1, '1342')
call axpyso(nioi41, fact, icore(i0), 1, wmbej(ioi4(1)), 1)
!                 
!==EmBj ABAB
!--<Ef||mN>*t1(fj)*t1(BN)=-<Ef|Nm>*t1(fj)*t1(BN)
call itranspso(iabij(ioi3(2)), icore(i1), vrta, vrtb, 1, popa, popb, 1, 1)
call VpqrmVms_to_Vpqrs(icore(i1), t1(ifvo(1)), 1, 1, vrtb, &
                 popa, popb, 1, vrta, popb, icore(i2), 1, 1.d0, 0.d0)
!--<Nm,Ej> to (Ej,Nm)
call itranspso(icore(i2), icore(i0), popa, popb, 1, vrta, popb, 1, 1)
call isymtrso(icore(i0), icore(i2), vrta, popb, 1, 0, popa, popb, 1, 1, 1)
call VpqrmVsm_to_Vpqrs(icore(i2), t1(ifvo(1)), 1, 1, popa, &
                 vrta, popb, 1, popb, vrta, icore(i1), 1, 1.d0, 0.d0)
!--tmp(Ej,mB) to EmBj
call sstgenso(icore(i1), icore(i2), nsize, vrta, popb, popb, vrta, &
              icore, 1, '1342')
call axpyso(nioi42,  -fact, icore(i2), 1, wmbej(ioi4(2)), 1)
!
!==EMbj AABB
!--<Ef||Mn>*t1(fj)*t1(bn)
call VpqrmVsm_to_Vpqrs(icore(i0), t1(ifvo(1)), 1, 1, popb, &
                 vrta, popb, 1, popa, vrtb, icore(i1), 1, 1.d0, 0.d0)
!--tmp(Ej,Mb) to EMbj
call sstgenso(icore(i1), icore(i2), nsize, vrta, popb, popa, vrtb, &
              icore, 1, '1342')
call axpyso(nioi45,  fact, icore(i2), 1, wmbej(ioi4(5)), 1)

return
end
